<template>
	<!-- 首页和跑团活动组件 -->
	<view class="">
		<view class="tiplist" v-if="runlist.length > 0">
			<view class="tiplist_list" @tap="toactivedetail(item.id)" v-for="(item, index) in runlist" :key="index">
				<view class="tiplist_top">
					<view class="tiplist_top_pic">
						<image :src="item.cover" mode=""></image>
						<!-- 赛事活动任务 -->
						<view class="kind">
							<image v-if="item.type == 2" src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/discover/run_active.png" mode="widthFix"></image>
							<image v-else-if="item.type == 1" src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/discover/run_recomm.png" mode="widthFix"></image>
							<image v-else src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/discover/run_renwu.png" mode="widthFix"></image>
						</view>
					</view>
					<view class="tiplist_top_info">
						<view class="tiplist_top_title shenglueh">
							<span v-if="item.is_official">官方</span>
							<!-- 	<view class="gf">
							官方
						</view> -->
							{{ item.name }}
						</view>
						<view class="tiplist_top_message">
							<view class="tiplist_top_message_t">
								<view class="tiplist_top_message_date">{{ item.startActive }}</view>
							</view>
							<view class="tiplist_top_message_area">{{ item.city }}</view>
						</view>
						<!-- 活动状态 -->
						<view class="bm_status">
							<span v-if="item.state == 0">报名中</span>
							<span class="hasend" v-else-if="item.state == 1">报名已结束</span>
							<span class="hasend" v-else-if="item.state == 2">报名未开始</span>
							<span class="hasend" v-else-if="item.state == 3">已结束</span>
							<span v-else>进行中</span>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 没有活动的时候 -->
		<view class="noactive" v-else>
			<image src="https://ykp-new.oss-cn-hangzhou.aliyuncs.com/client/index/nodata.png" mode=""></image>
			<view class="noactive_ac">暂无活动</view>
		</view>
	</view>
</template>

<script>
export default {
	props: ['runlist'],
	data() {
		return {};
	},
	mounted() {
		//  // console.log (this.runlist)
	},
	methods: {
		toactivedetail(key) {
			this.$emit('toactivedetail', key);
		}
	}
};
</script>

<style lang="less" scoped>
.uni-loadmore {
	text-align: center;
	font-size: 28upx;
	height: 60upx;
	line-height: 60upx;
}
.tiplist {
	background-color: #ffffff;
	overflow: hidden;
	.tiplist_top {
		width: 100%;
		height: 140upx;
		display: flex;
		justify-content: space-between;
		.tiplist_top_pic {
			width: 250upx;
			height: 140upx;
			margin-right: 20upx;
			position: relative;
			image {
				width: 100%;
				height: 100%;
				border-radius: 10upx;
			}
			.kind {
				position: absolute;
				width: 44upx;
				height: 40upx;
				top: 0;
				background-color: ;
				left: 26upx;
				image {
					// width: 44upx;
					width: 100%;
					height: 100%;
					border-radius: 0;
				}
			}
		}
		.tiplist_top_info {
			width: 420upx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			position: relative;
			.tiplist_top_title {
				font-size: 28upx;
				line-height: 36upx;
				color: #333333;
				font-weight: bold;
				.gf {
					display: inline-block;
					width: 58upx;
					height: 32upx;
					background-color: #8738d2;
					border-radius: 4upx;
					color: #ffffff;
					text-align: center;
					line-height: 32upx;
					font-size: 20upx;
					margin-right: 14upx;
				}
				span {
					display: inline-block;
					width: 64upx;
					height: 32upx;
					background-color: #8738d2;
					border-radius: 4upx;
					color: #ffffff;
					text-align: center;
					line-height: 32upx;
					font-size: 24upx;
					margin-right: 14upx;
				}
			}
			.tiplist_top_message .tiplist_top_message_t {
				display: flex;
				justify-content: space-between;
				.tiplist_top_message_date {
					font-size: 24upx;
					color: #666;
				}
				.tiplist_top_message_people {
					font-size: 24upx;
					color: #ff6600;
				}
			}
			.tiplist_top_message_area {
				font-size: 24upx;
				color: #666;
			}
		}
	}
	.tiplist_bottom {
		display: flex;
		justify-content: space-between;
		height: 80upx;
		align-items: center;
		border-bottom: 1upx solid #e1e1e1;
		.tiplist_name {
			font-size: 24upx;
			color: #333333;
			.icon {
				font-size: 24upx;
				margin-left: 6upx;
			}
		}
		.tiplist_state {
			font-size: 28upx;
			color: #8839d2;
			font-weight: bold;
			.hasend {
				color: #c1c1c1;
			}
		}
	}
}
.tiplist_list {
	height: 180upx;
	border-bottom: 2upx solid #e1e1e1;
	display: flex;
	align-items: center;
}
.tiplist_list:last-child {
	border-bottom: 0;
}
.bm_status {
	position: absolute;
	bottom: 0;
	right: 0;
	font-size: 28upx;
	color: #8838d2;
	font-weight: bold;
}
// 没有活动
.noactive {
	width: 150upx;
	margin: auto;
	margin-top: 80upx;
	text-align: center;
	image {
		width: 150upx;
		height: 140upx;
	}

	.noactive_ac {
		font-size: 28upx;
		color: #999999;
	}
}
</style>
